package cn.kgc.kgde.bookstore.service.impl;

import cn.kgc.kgde.bookstore.entity.OrderDetail;
import cn.kgc.kgde.bookstore.mapper.OrderDetailMapper;
import cn.kgc.kgde.bookstore.service.OrderDetailService;
import com.baomidou.mybatisplus.core.conditions.Wrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.beans.Transient;
import java.util.List;

/**
 * <p>
 *  服务实现类
 * </p>
 *
 * @author myt
 * @since 2022-05-23
 */
@Service
public class OrderDetailServiceImpl extends ServiceImpl<OrderDetailMapper, OrderDetail> implements OrderDetailService {

    @Resource
    private OrderDetailMapper orderDetailMapper;

    //根据订单 -- 查看订单详情
    @Override
    public List<OrderDetail> findOrderList(String orderId) {
        QueryWrapper<OrderDetail> wrappers = new QueryWrapper<>();
        //根据传过来的 orderId 查询到 所有订单详情
        wrappers.eq( "orderId",orderId );
        return orderDetailMapper.selectList( wrappers );
    }
}
